package persistence.hibernate;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import persistence.Dummy;
import persistence.PersistenceControllerTest;
import persistence.hibernate.HibernatePersistenceController;

/**
 * @author idan
 */
public class HibernatePersistenceControllerTest extends PersistenceControllerTest
{
	private SessionFactory sessionFactory ;

	public HibernatePersistenceControllerTest()
	{
		Configuration config = new Configuration() ;
		config.configure() ;
		this.sessionFactory = config.buildSessionFactory() ;
	}

	/**
	 * @see persistence.PersistenceControllerTest#getNewPersistence(boolean)
	 */
	@Override
	protected HibernatePersistenceController getNewPersistence(final boolean load)
	{
		HibernatePersistenceController persistence = new
			HibernatePersistenceController(Dummy.class, load, this.sessionFactory) ;
		return persistence ;
	}

}
